﻿using SelfManagement.Data.Constant;
using SelfManagement.Database.POCO;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace SelfManagement.Web.Models.ViewModels.AccountModels
{
    public class MyProfileViewModel
    {
        [Display(Name = "真实姓名")]
        public string TrueName { get; set; }

        [Display(Name = "头像")]
        public string UserFace { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Display(Name = "性别")]
        public Sex Sex { get; set; }

        public IEnumerable<SelectListItem> SexOptions { get; set; }

        /// <summary>
        /// 身份
        /// </summary>
        [StringLength(100)]
        [Display(Name = "身份")]
        public string Identity { get; set; }

        /// <summary>
        /// 个人简介
        /// </summary>
        [StringLength(500)]
        [Display(Name = "个人简介")]
        public string PersonalInfo { get; set; }


        [Display(Name = "密码")]
        [RegularExpression(pattern: ValidationConstant.PasswordValReg, ErrorMessage = ValidationConstant.PasswordValMessage)]
        public string Password { get; set; }
        
        [Display(Name = "新密码")]
        [RegularExpression(pattern: ValidationConstant.PasswordValReg, ErrorMessage = ValidationConstant.PasswordValMessage)]
        public string NewPassword { get; set; }

        [Display(Name = "确认密码")]
        [RegularExpression(pattern: ValidationConstant.PasswordValReg, ErrorMessage = ValidationConstant.PasswordValMessage)]
        [System.ComponentModel.DataAnnotations.Compare("NewPassword")]
        public string RPassword { get; set; }
    }
}
